package com.ljj.enums;

import java.util.Scanner;

/**
 * 定义策略枚举类
 */
public enum Strategy {
    FAST{
        @Override
        public void run(){
            Scanner scan = new Scanner(System.in);
            System.out.println("请输入数字进行加法计算：");
            int num1=scan.nextInt();
            int num2=scan.nextInt();
            int num3=num1+num2;
            System.out.println("结果为:"+num3);

        }
    },
    NORMAL {
        @Override
        public void run() {
            System.err.println("NORMAL");
        }
    },
    SMOOTH {
        @Override
        public void run() {
            System.err.println("SMOOTH");
        }
    },
    SLOW {
        @Override
        public void run() {
            System.err.println("SLOW");
        }
    };

    public abstract void run();
}
